load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "bulk",
    srcs = [
        "buffering_adder.go",
        "bulk_metrics.go",
        "kv_buf.go",
        "setting.go",
        "sst_batcher.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/kv/bulk",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/bulk/bulkpb",
        "//pkg/kv/kvclient/rangecache",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/kvserverbase",
        "//pkg/roachpb",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/storage",
        "//pkg/storage/enginepb",
        "//pkg/util/admission/admissionpb",
        "//pkg/util/ctxgroup",
        "//pkg/util/hlc",
        "//pkg/util/humanizeutil",
        "//pkg/util/limit",
        "//pkg/util/log",
        "//pkg/util/metric",
        "//pkg/util/mon",
        "//pkg/util/retry",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "//pkg/util/tracing",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "bulk_test",
    size = "medium",
    srcs = [
        "kv_buf_test.go",
        "main_test.go",
        "split_sst_test.go",
        "sst_batcher_test.go",
    ],
    embed = [":bulk"],
    deps = [
        "//pkg/base",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvclient/kvcoord",
        "//pkg/kv/kvclient/rangecache",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/kvserverbase",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/settings/cluster",
        "//pkg/storage",
        "//pkg/storage/enginepb",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/storageutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/encoding",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/limit",
        "//pkg/util/log",
        "//pkg/util/mon",
        "//pkg/util/randutil",
        "//pkg/util/timeutil",
        "//pkg/util/tracing",
        "@com_github_stretchr_testify//require",
    ],
)
